<template>
  <div>
    <projecBrief :data="formData9">
      <projectRewarded
        slot="itemMain0"
        :headData="headData"
        :mainList="OrgList"
        @add="add('OrgList')"
      ></projectRewarded>
      <projectRewarded
        slot="itemMain2"
        :headData="intellectualProperty"
        :mainList="EvidenceList"
        @add="add('EvidenceList')"
      ></projectRewarded>
    </projecBrief>
  </div>
</template>

<script>
import projecBrief from "@/components/form/projectBrief.vue";
import { formData9 } from "@/assets/js/projectInfoFormData.js";
import projectRewarded from "@/components/form/projectRewarded.vue";
import { mapState } from "vuex";
export default {
  // eslint-disable-next-line vue/no-unused-components
  components: { projecBrief, projectRewarded },
  data() {
    return {
      formData9,
      headData: [
        {
          title: "应用起始时间",
          ajaxStr: "beginTime",
        },
        {
          title: "单位名称",
          ajaxStr: "orgName",
        },
        {
          title: "应用单位联系人及电话",
          ajaxStr: "callNamePhone",
        },
        {
          title: "使用本项目产生的经济效益(元)",
          ajaxStr: "money",
        },
        {
          title: "已提交应用证明",
          ajaxStr: "prove",
        },
      ],
      intellectualProperty: [
        {
          title: "授权（申请）项目名称",
          ajaxStr: "eviName",
        },
        {
          title: "知识产权类别",
          ajaxStr: "eviType",
        },
        {
          title: "国别",
          ajaxStr: "countries",
        },
        {
          title: "申请号",
          ajaxStr: "appId",
        },
        {
          title: "授权号",
          ajaxStr: "authId",
        },
      ],
    };
  },
  computed: {
    ...mapState({
      OrgList: (state) => state.declare.proUseOrgList,
      EvidenceList: (state) =>
        state.declare.proIntellectualPropertyEvidenceList,
    }), 
  },
  methods: {
    add(type) {
      let declare = JSON.parse(sessionStorage.getItem("declare"));
      let item =
        type == "OrgList"
          ? declare.proUseOrgList[0]
          : declare.proIntellectualPropertyEvidenceList[0];
      console.log(item);
      type == "OrgList" && this.OrgList.push(item);
      type == "EvidenceList" &&
        this.EvidenceList.push(item);
    },
  },
};
</script>

<style>
</style>